import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.JsePlatform;

/**
 *  Simple program to test call-cc lua implementation 
 *  with the interpreter.
 */

/**
 * @author Marie-Diana
 *
 */
public class SampleCallCCJseMain {

	public static void main(String[] args) throws Exception {
		String script = "test/lua/simple_callcc.lua";
		String callcc = "test/lua/callcc.lua";
		
		// create an environment to run in
		Globals globals = JsePlatform.standardGlobals();
		
		// Use the convenience function on Globals to load a chunk.
		LuaValue chunk = globals.loadfile(callcc);
		chunk = globals.loadfile(script);
		
		// Use any of the "call()" or "invoke()" functions directly on the chunk.
		chunk.call( LuaValue.valueOf(script) );
	}
	
}
